import request from '@/utils/request'

// 获取个人文章列表
export function getArticleList() {
  return request({
    url: '/user/article/me',
    method: 'get',
  })
}

// 发布文章
export function publishArticle(data: any, daid: number | string) {
  return request({
    url: `/user/article/type/${daid}`,
    method: 'post',
    data,
  })
}

// 获取文章详情
export function getArticle(id: number | string) {
  return request({
    url: `/user/article/id/${id}`,
    method: 'get',
  })
}

// 删除文章
export function deleteArticle(id: number | string) {
  return request({
    url: `/user/article/id/${id}`,
    method: 'delete',
  })
}